package com.wkt.ggkt.vod.controller;


import com.wkt.ggkt.result.Result;
import com.wkt.ggkt.vod.service.VideoVisitorService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * <p>
 * 视频来访者记录表 前端控制器
 * </p>
 *
 * @author wkt
 * @since 2023-11-29
 */
@RestController
@RequestMapping("/admin/vod/videoVisitor")
//@CrossOrigin
public class VideoVisitorController {

    @Resource
    private VideoVisitorService videoVisitorService;

    @ApiOperation(value = "统计观看人数")
    @GetMapping("/findCount/{courseId}/{startDate}/{endDate}")
    public Result findCount(@PathVariable("courseId") Long courseId,
                            @PathVariable(value = "startDate",required = false) String startDate,
                            @PathVariable(value = "endDate",required = false) String endDate) {
       Map<String, Object> resMap = videoVisitorService.findCount(courseId,startDate,endDate);
       return Result.ok(resMap);
    }

}

